<include file="public:header" /><br>
<script src="http://o9kxq6gms.bkt.clouddn.com/z.js"></script>
<script type='text/html' id='Template'>
<option value="<%=id%>"><%=name%></option>
</script>
<!--会员列表-->
<div class="pad_lr_10" >
    <form name="searchform" method="get" >
    <table width="100%" cellspacing="0" class="search_form">
        <tbody>
            <tr>
                <td>
                <div class="explain_col">
                    <input type="hidden" name="g" value="admin" />
                    <input type="hidden" name="m" value="capital_status" />
                    <input type="hidden" name="a" value="index" />
                    <input type="hidden" name="menuid" value="{$menuid}" />
                    <input type="hidden" name="type" value="{$search.type}" />
                    
                      <span class="select_shelter"> 
                                <select name="topkey" class="order_select " style="width:112px;" onchange="ChangeCallback_ext(this);">
                                    <option value="">团队名称(全部)</option>
                                    <volist name="topkey" id="val">
                                        <if condition="$key egt 0">
                                            <option value="{$val}"
                                            <if condition="$search.topkey eq $val">selected</if>
                                            >{$val}</option>
                                        </if>
                                    </volist>
                                </select>
                      
                                        <select id="krosrow0" name="tgroup_1"    onchange="ChangeCallback(this);" class="J_user_select" data-pid="0" data-selected="" data-uri="/lib/weitang/index.php/?g=admin&amp;m=team&amp;a=tgroup_child&amp;topkey=杭州test" data-name="tgroup_" data-nums="">
                                          <option value="" selected="selected">--请选择--</option>
                                          <option value="{$id}">{$username}</option></select>
                                        <select id="krosrow1"  name="tgroup_2"    onchange="ChangeCallback(this);" class="J_user_select mr10" data-pid="483" >
                                          <option value="">--请选择--</option>
                                         </select>
                                        <select id="krosrow2" name="tgroup_3" style="display:none" onchange="ChangeCallback(this);" class="J_user_select mr10" data-pid="488" >
                                          <option value="">--请选择--</option>
                                          </select>
                                            <select id="krosrow3" name="tgroup_4" style="display:none" onchange="ChangeCallback(this);" class="J_user_select mr10" data-pid="488" >
                                          <option value="">--请选择--</option>
                                          </select>
                                        <select id="krosrow4" name="tgroup_5" style="display:none" onchange="ChangeCallback(this);" class="J_user_select mr10" data-pid="488" >
                                          <option value="">--请选择--</option>
                                          </select>
                                   
                                </span>
                        
                        
                        
                        
                      

                    <input type="submit" name="search" class="btn" value="搜索" />
                    <input type="submit" name="export" class="btn mr10" value="导出到Excel文件">
                </div>
                </td>
            </tr>
        </tbody>
    </table>
    </form>
    <div class="">
        当前团队余额:{$sum_price_}<br> 当前级别:{$search.topkey}
        <if condition="$search.tgroup_1 neq ''">->{$search.tgroup_1}</if>
        <if condition="$search.tgroup_2 neq ''">->{$search.tgroup_2}</if>
        <if condition="$search.tgroup_3 neq ''">->{$search.tgroup_3}</if>
        <if condition="$search.tgroup_4 neq ''">->{$search.tgroup_4}</if>
        <if condition="$search.tgroup_5 neq ''">->{$search.tgroup_5}</if>
    </div>
    <div class="J_tablelist table_list" data-acturi="">
    <table width="100%" cellspacing="0">
        <thead>
            <tr>
                <th width="120" align="left">用户账号</th> 
                <th width="120" align="left">手机号</th> 
                <th width="120" align="left">用户类型</th> 
                <th width="100" align="left">充值</th>
                <th width="100" align="left">提现</th>
                <th width="100" align="left">订单消费</th>
                <th width="100" align="left">升级成功退款</th>
                <th width="120" align="left">提货运费</th>
                <th width="120" align="left">返佣</th>
                <th width="120" align="left">当前余额</th>
                <th width="120" align="left">代理商名称</th>
                <th width="120" align="left">经销商名称</th>
                <th width="120" align="left">总经销商名称</th>
                <th width="100"align="left">团队名称</th>
                
            </tr>
        </thead>
        <tbody>
            <volist name="list" id="val" >
            <tr>
            <td align="left">{$val.uname}</td>
            <td>{$val.tele}</td>
            <td>{$val.tgroup_name}</td>
           <td>{$val.recharge}</td>
           <td>{$val.cash}</td>
           <td>{$val.order1}</td>
           <td>{$val.order_refund}</td>
          <td>{$val.express}</td>
          <td>{$val.commission}</td>
          <td>{$val.now_price}</td>
          <td>{$val.tgroup_3_name}</td>
          <td>{$val.tgroup_2_name}</td>
          <td>{$val.tgroup_1_name}</td>
           <td>{$val.topkey}</td>
            
            </tr>
            </volist>
        
        <tr>
                <td align="left">合计:</td>
            <td></td>
            <td></td>
            <td>{$sum[1]}</td>
           <td>{$sum[2]}</td>
           <td>{$sum[3]}</td>
           <td>{$sum[4]}</td>
           <td>{$sum[5]}</td>
          <td>{$sum[6]}</td>
          <td></td>
          <td></td>
           <td></td>
            
            </tr>
        </tbody>
    </table>
    <div class="btn_wrap_fixed">
        <!-- <label class="select_all"><input type="checkbox" name="checkall" class="J_checkall">{:L('select_all')}/{:L('cancel')}</label>
        <input type="button" class="btn" data-tdtype="batch_action" data-acttype="ajax" data-uri="{:U('user_recharge/delete')}" data-name="id" data-msg="{:L('confirm_delete')}" value="{:L('delete')}" /> -->
        <div id="pages">{$page}</div>
    </div>

    </div>
</div>
<include file="public:footer" />
</body>
</html>
<link rel="stylesheet" type="text/css" href="__STATIC__/js/calendar/calendar-blue.css"/>
<script type="text/javascript" src="__STATIC__/js/calendar/calendar.js"></script>
<script>
    function ChangeCallback(_self)
{
    
    var parent_id = _self.value;
    var id= $(_self).attr('value');
       // alert(id)
        if(!id)
    {
        return;
    }
        
        var aid = $(_self).attr('id');
        aid= aid.substr(aid.length-1,1)
           
        aid=parseInt(aid)+1;
        aid=aid.toString()
        var url = '    {:U('mall/index/tgroup_child1')}';

    $.getJSON(url,{'id':id},function(json)
    {
        var json2=json.data
        $('#krosrow'+aid).empty().append(' <option value="">--请选择--</option>');
            for(var item in json2)
        {
            
//            alert(json2[item])

            var html = template.render('Template',json2[item]);
            $('#krosrow'+aid).append(html);


        }
       // alert(json.status)
        if(json.status==1){
            $('#krosrow'+aid).css({ display: "inline-block" }); 
        }else{
            
            aid= aid.substr(aid.length-1,1)
           
            aid=parseInt(aid)-1;
            var Things= $('#krosrow'+aid).nextAll()
          
            Things.empty().css({ display: "none" })

            
        }
                 


    });
        
          

    
}

   function ChangeCallback_ext(_self)
{
    
    var parent_id = _self.value;
    var id= $(_self).attr('value');
//       alert(id)
        if(!id)
    {
        return;
    }
        

        var url = '{:U('mall/index/tgroup_child_ext')}';
        $.getJSON(url,{'id':id},function(json)
        {
            var json2=json.data
            $('#krosrow'+0).empty().append(' <option value="">--请选择--</option>');
                for(var item in json2)
            {

    //            alert(json2[item])

                var html = template.render('Template',json2[item]);
                $('#krosrow'+0).append(html);


            }
           // alert(json.status)
            if(json.status==1){
                $('#krosrow'+aid).css({ display: "inline-block" }); 
            }else{

                aid= aid.substr(aid.length-1,1)

                aid=parseInt(aid)-1;
                var Things= $('#krosrow'+aid).nextAll()

                Things.empty().css({ display: "none" })


            }



        });
        
          

    
}
    </script>